package org.pearl.thread.demo.test001;

/**
 * Created by TD on 2021/4/11
 */
public class ThreadStatusTest001 {
    public static void main(String[] args) {
        // 创建线程
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    System.out.println(Thread.currentThread().getName() + " is running..." + i); // t1
                    try {
                        //  Thread.sleep进入计时等待1秒钟
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        t1.start();
        System.out.println(Thread.currentThread().getName() + " is running..."); //main
    }
}
